/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package knowledgebase.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author eugene
 */
@Entity
@Table(name = "ROLE_DOCUMENT_BLOCK_ACCESS")
public class RoleDocumentBlockAccess implements Serializable {
    
    @Id
    @Column(name = "ROLE_DOCUMENT_BLOCK_ACCESS_ID")
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long id;
    
    @ManyToOne
    @JoinColumn(name = "DOC_BLOCK_ID")
    private DocumentBlock block;
    
    @ManyToOne
    @JoinColumn(name = "ACCESS_TYPE_ID")
    private AccessType accessType;

    public RoleDocumentBlockAccess() {
    }

    public RoleDocumentBlockAccess(Long id, DocumentBlock block, AccessType accesType) {
        this.id = id;
        this.block = block;
        this.accessType = accesType;
    }

    public void setAccessType(AccessType accesType) {
        this.accessType = accesType;
    }

    public void setBlock(DocumentBlock block) {
        this.block = block;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public AccessType getAccessType() {
        return accessType;
    }

    public DocumentBlock getBlock() {
        return block;
    }

    public Long getId() {
        return id;
    }
    
}
